/**
 * 修复微信小游戏对PIXIJS的支持
 * @update 2018.08.05
 */

export default {
  init (app) {
    let {PIXI, SYS_INFO} = app.constructor
    PIXI.utils.isWebGLSupported = () => {
      return canvas.getContext('webgl')
    }

    PIXI.interaction.InteractionManager.prototype.mapPositionToPoint = (point, x, y) => {
      point.x = x * SYS_INFO.pixelRatio
      point.y = y * SYS_INFO.pixelRatio
    }
  }
}